- array
- The one-dimensional System.Array that is the destination of the elements copied from ICollection. The System.Array must have zero-based indexing.
- arrayIndex
- The zero-based index in array at which copying begins.
Visual Basic (Declaration) | |
---|---|
Public Sub CopyTo( _ ByVal array() As T, _ ByVal arrayIndex As Integer _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As ThreadSafeList(Of T) Dim array() As T Dim arrayIndex As Integer instance.CopyTo(array, arrayIndex) |
C# | |
---|---|
public void CopyTo( T[] array, int arrayIndex ) |
C++/CLI | |
---|---|
public: void CopyTo( array<T^>^ array, int arrayIndex ) |
Parameters
- array
- The one-dimensional System.Array that is the destination of the elements copied from ICollection. The System.Array must have zero-based indexing.
- arrayIndex
- The zero-based index in array at which copying begins.
Exception | Description |
---|---|
System.ArgumentNullException | is null. |
System.ArgumentOutOfRangeException | is less than 0. |
System.ArgumentException | is multidimensional. -or- is equal to or greater than the length of . -or- The number of elements in the source is greater than the available space from to the end of the destination . -or- Type T cannot be cast automatically to the type of the destination . |
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7